package com.xand.bt.util;

import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;

public class HttpHelper {

	public static String downloadWebPage(String webUrl) throws IOException {

		StringBuilder ret = new StringBuilder();


		String line;
		
		URL url = new URL(webUrl);
		InputStream is = url.openStream();  // throws an IOException
		DataInputStream dis = new DataInputStream(new BufferedInputStream(is));

		while ((line = dis.readLine()) != null) {
			ret.append(line);
		}
		is.close();

		return ret.toString();

	}

}
